﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DAO
{
    public class NguoiDungDAO
    {
        private studial1Entities db;

        public NguoiDungDAO()
        {
            db = new studial1Entities();
        }

        public List<NguoiDung> LietKe()
        {
            List<NguoiDung> lstNguoiDung = new List<NguoiDung>();
            var temp = db.NguoiDungs;
            foreach (var item in temp)
                lstNguoiDung.Add(item);
            return lstNguoiDung;
        }

        public void ThemNguoiDung(NguoiDung nd)
        {
            db.NguoiDungs.AddObject(nd);
            db.SaveChanges();
        }
    }
}
